package com.example.demo.processor;

/**
 * @author wzs
 * @description
 * @name MainConfig
 * @date 2021年11月11日 9:01
 */

import com.example.demo.entity.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class MainConfig {
    @Bean(name = "person",initMethod = "myInit")
    public Person person(){
        Person person = new Person();
        person.setAddress("beijing");
        person.setPhone(111L);
        System.out.println(
                "实例化一个person对象，初始化其初始化的方法"
        );
        return person;
    }
}
